<%@ page contentType="text/html; charset=utf-8"%>
<%@ include file="../../../common/include.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<jsp:include page="../../../common/head.jsp">
			 <jsp:param name="_spPage" value="true"/>
			 <jsp:param name="_useCalendar" value="true"/>
		</jsp:include>

		<title>汇总上报</title>
		<script language="JavaScript">
			function editData(feeReportId)
			{
				window.location.href = "updateReportFeeDetail.do?feeReportId="+feeReportId;
			}
			function showData(feeReportId)
			{
				window.location.href = "showReportFeeDetail.do?feeReportId="+feeReportId;
			}
			//数据上报
			function reportData(feeReportId)
			{
				if(confirm("确认上报？"))
				{
					ModalWindow("jump.do?path=reportFeeDetail.do&feeReportId="+feeReportId,640,480);
					xjSpPage.spPageSubmit();
				}
			}
			//删除汇总上报
			function deleteData(feeReportId)
			{
				if(confirm("确认删除？"))
				{
					ModalWindow("jump.do?path=deleteReportFeeDetail.do&feeReportId="+feeReportId,640,480);
					xjSpPage.spPageSubmit();
				}
			}

			$.ready = function()
			{
				$("#feeReportYear").val("${feeReport.feeReportYear}");
			}
		</script>
	</head>
	<body>
	<form action="listReportFeeDetail.do" name="form1" id="form1" method="post">
	<div id="body_div">
	<w:ShowTitle name="费用上报" useSubmitKey="false">
	<w:TitleButton funcName="查询" onClickFunction="_queryDivBg(this)" urlImg="${ctx}/images/main/query.png"/>
	</w:ShowTitle>
	<div id="body_content">
				<div id="queryDiv">
			<table width="100%" border="0">
				<tr>
					<td colspan="4" class="td_title">
						费用上报查询
					</td>
				</tr>
				<tr>
					<td>地区</td>
					<td class="left_align">
						<w:select name="feeReport.areaId" value="${feeReport.areaId}">
							<w:option optionLabel="请选择" optionValue=""></w:option>
							<w:options options="${CodeDict}" optionLabel="codeName" optionValue="codeId" filterFieldName="parentCodeId" filterFieldValue="001"></w:options>
						</w:select>
					</td>
					<td>事业部</td>
					<td class="left_align">
              			<w:select name="feeReport.areaDeptId" value="${feeReport.areaDeptId}">
							<w:option optionLabel="请选择" optionValue=""></w:option>
							<w:options options="${CodeDict}" optionLabel="codeName" optionValue="codeId" filterFieldName="parentCodeId" filterFieldValue="002"></w:options>
						</w:select>
           			</td>  
				</tr>
				<tr>
					<td>年度</td>
					<td class="left_align">
						<select name="feeReport.feeReportYear" id="feeReportYear"  class="selectLengthAuto">
		      				<option value="">请选择</option>
		      				<c:forEach begin="2013" end="${wfn:getDateTime('yyyy')}" var="year">
		      					<option value="${year}">${year}</option>
		      				</c:forEach>
		      			</select>
					</td>
					<td>月份</td>
					<td class="left_align">
						<w:select name="feeReport.feeReportMonth" styleId="feeReportMonth" styleClass="selectLengthAuto" value="${feeReport.feeReportMonth}">
							<w:option optionLabel="请选择" optionValue=""></w:option>
							<w:option optionLabel="01" optionValue="01"></w:option>
							<w:option optionLabel="02" optionValue="02"></w:option>
							<w:option optionLabel="03" optionValue="03"></w:option>
							<w:option optionLabel="04" optionValue="04"></w:option>
							<w:option optionLabel="05" optionValue="05"></w:option>
							<w:option optionLabel="06" optionValue="06"></w:option>
							<w:option optionLabel="07" optionValue="07"></w:option>
							<w:option optionLabel="08" optionValue="08"></w:option>
							<w:option optionLabel="09" optionValue="09"></w:option>
							<w:option optionLabel="10" optionValue="10"></w:option>
							<w:option optionLabel="11" optionValue="11"></w:option>
							<w:option optionLabel="12" optionValue="12"></w:option>
						</w:select>
           			</td>  
				</tr>
				<tr>
					<td>状态</td>
					<td class="left_align">
						<w:select name="feeReport.reportState" styleId="reportState" value="${feeReport.reportState}">
							<w:option optionLabel="全部" optionValue=""></w:option>
							<w:option optionLabel="未上报" optionValue="未上报"></w:option>
							<w:option optionLabel="已上报" optionValue="已上报"></w:option>
						</w:select>
					
           			</td>  
					<td class="right_align">编号</td>
		              <td class="left_align">
		              	<input type="text" id="feeReportCode" name="feeReport.feeReportCode" value="${feeReport.feeReportCode}"/>
		              </td>
				</tr>
				<tr>
					 <td colspan="4">
						<input name="button" type="submit" class="btn_standard" onclick="" value="查询" />
						<input name="button" type="button" class="btn_standard" onclick="_cancelQuery()" value="取消" />
					</td>
				</tr>
			</table>
			</div>	
				<table width="100%" class="listTable">
					<tr>
                        <td width="150" class="td_title">编号</td>
                        <td width="150" class="td_title">地区</td>
                        <td class="td_title">事业部</td>
                        <td class="td_title">年度</td>
                        <td class="td_title">月份</td>
                        <td class="td_title">截止日期</td>
                        <td width="80" class="td_title">票据金额</td>
                        <td width="80" class="td_title">凭证金额</td>
                        <td width="130" class="td_title">操作</td>
                      </tr>
					<c:forEach items="${datalist}" var="obj">
						<tr>
							<td>${obj.feeReportCode}</td>
							<td class="left_align">${obj.areaName}</td>
							<td class="left_align">${obj.areaDeptName}</td>
							<td class="left_align">${obj.feeReportYear}</td>
							<td class="left_align">${obj.feeReportMonth}</td>
							<td class="left_align"><fmt:formatDate value='${obj.endDate}' pattern="yyyy-MM-dd" /></td>
							<td class="left_align">${obj.reportBillAmount}</td>
							<td class="left_align">${obj.reportCertificateAmount}</td>
							<td>
								<c:if test="${obj.reportState eq '未上报'}">
								<a href="#" onclick="javascript:editData('${obj.feeReportId}')">修改</a>
								<a href="#" onclick="javascript:deleteData('${obj.feeReportId}')">删除</a>
								<a href="#" onclick="javascript:reportData('${obj.feeReportId}')">上报</a>
								</c:if>
								<a href="#" onclick="javascript:showData('${obj.feeReportId}')">查看</a>
							</td>
						</tr>
					</c:forEach>
				</table>
				<w:spPage />
			</div>
		</div>	
		</form>
	</body>
</html>